package org.bloodnoteii.cloudconsumer.Hello.controller;

import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.*;
import org.bloodnoteii.cloudconsumer.Hello.Consumer.HelloConsumer;
import org.bloodnoteii.cloudconsumer.Hello.services.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Api("Hello")

public class helloConsumerController {
    @Autowired
    private HelloConsumer helloConsumer;

    @ApiOperation(value = "Hello测试", notes = "测试")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "id", paramType = "path", value = "id", required = true, dataType = "String", defaultValue = "1"),
//    })
    @PostMapping(value="/user", consumes = "application/json", produces = "application/json")
    public JSONObject helloConsumer(@ApiParam(value="入参") @RequestBody String id) {
        Integer idi = Integer.parseInt(id);
        JSONObject result = helloConsumer.helloConsumer(idi);

        return result;
    }
}
